﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NUnit.Framework;
using NuMvvm.Commands;

namespace NuMvvm.Tests
{
    [TestFixture]
    public class RelayCommandTest
    {
        [TestCase]
        public void RelayCommand()
        {
            bool called = false;

            var relayCommand = new DelegateCommand(() => { called = true; });
            relayCommand.Execute();

            Assert.IsTrue(called);
        }

        [TestCase]
        public void RelayCommandGeneric()
        {
            string result = null;

            var relayCommand = new DelegateCommand<string>((arg) =>
            {
                result = arg;
            });

            relayCommand.Execute("Hello World!");

            Assert.AreEqual(result, "Hello World!");
        }
    }
}
